﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SqlSugarCoreDemo.DBSqlSugar
{ 
    /// <summary>
  /// 事务工作单元接口类
  /// </summary>
    public interface IUnitOfWork
    {
        /// <summary>
        /// 创建数据库对象
        /// </summary>
        /// <returns></returns>
        SqlSugarScope GetDbClient();

        /// <summary>
        /// 启动事务
        /// </summary>
        void BeginTran();

        /// <summary>
        /// 提交事务
        /// </summary>
        void CommitTran();

        /// <summary>
        /// 事务回滚
        /// </summary>
        void RollbackTran();
    }
}
